<!DOCTYPE html>
<html>
<head>
    <title>Prototype Pattern Example</title>
    <script type="text/javascript">
                    
        function Person(){
        }
        
        var friend = new Person();
                
        Person.prototype = {
            constructor: Person,
            name : "Nicholas",
            age : 29,
            job : "Software Engineer",
            sayName : function () {
                alert(this.name);
            }
        };
        
        friend.sayName();   //error


        
    </script>
</head>
<body>

</body>
</html>